<template>
	<view>
		<swiper class="screen-swiper square-dot" :indicator-dots="true" :circular="true" :autoplay="true"
			interval="5000" duration="500">
			<swiper-item>
				<image src="/static/images/swiper1.jpg" mode="aspectFill"></image>
			</swiper-item>
			<swiper-item>
				<image src="/static/images/swiper2.jpg" mode="aspectFill"></image>
			</swiper-item>
		</swiper>
		<view class="bg-white margin-top">
			<u-grid :col="3">
				<u-grid-item @click="nav('/pages/org/org-list')">
					<u-image width="80rpx" height="80rpx" src="/static/images/org.png"></u-image>
					<view class="margin-top-xs">组织管理</view>
				</u-grid-item>
				<u-grid-item @click="nav('/pages/user/org-list')">
					<u-image width="80rpx" height="80rpx" src="/static/images/user.png"></u-image>
					<view class="margin-top-xs">人员管理</view>
				</u-grid-item>
				<u-grid-item @click="nav('/pages/role/role-list')">
					<u-image width="80rpx" height="80rpx" src="/static/images/role.png"></u-image>
					<view class="margin-top-xs">角色管理</view>
				</u-grid-item>
				<u-grid-item @click="nav('/pages/role/perm-list')">
					<u-image width="80rpx" height="80rpx" src="/static/images/perm.png"></u-image>
					<view class="margin-top-xs">权限管理</view>
				</u-grid-item>
				<u-grid-item @click="nav('/pages/dict/dict-list')">
					<u-image width="80rpx" height="80rpx" src="/static/images/dict.png"></u-image>
					<view class="margin-top-xs">数据字典</view>
				</u-grid-item>
				<u-grid-item @click="nav('/pages/client/client-list')">
					<u-image width="80rpx" height="80rpx" src="/static/images/app_client.png"></u-image>
					<view class="margin-top-xs">应用授权</view>
				</u-grid-item>
				<u-grid-item @click="nav('/pages/sched/exec-list')">
					<u-image width="80rpx" height="80rpx" src="/static/images/scheduler.png"></u-image>
					<view class="margin-top-xs">定时调度</view>
				</u-grid-item>
			</u-grid>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {}
		},
		onLoad() {},
		onShow() {
			this.isLogin();
		},
		methods: {
			isLogin() {
				if (!this.$http.getToken()) {
					this.$utils.modal("提示", "请先登录！", true, (flag) => {
						if (flag) {
							uni.navigateTo({
								url: "../login/login"
							})
						}
					});
				}
			},
			nav(path) {
				uni.navigateTo({
					url: path
				});
			}
		}
	}
</script>

<style>
</style>
